package com.school.manager.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.school.manager.domaim.SysPermission;
import com.school.manager.entity.po.SysPermissionPo;
import com.school.manager.entity.vo.SysPermissionVo;
import com.school.manager.mapper.SysPermissionMapper;
import com.school.manager.service.ISysPermissionService;
import com.school.manager.utils.PageUtil;

import lombok.extern.slf4j.Slf4j;

/**
 * description：系统权限业务实现类
 * date：2021/10/133:18 下午
 */

@Service
@Slf4j
public class SysPermissionServiceImpl extends ServiceImpl<SysPermissionMapper, SysPermission> implements ISysPermissionService {
	
	@Autowired
    private SysPermissionMapper sysPermissionMapper;
	
	@Override
	public Page<SysPermissionVo> page(SysPermissionPo sysPermissionPo) {
		QueryWrapper<SysPermission> queryWrapper = PageUtil.buildQueryWrapper(sysPermissionPo, SysPermission.class);
        Page<SysPermission> page = new Page<>(sysPermissionPo.getCurrent(), sysPermissionPo.getSize());
        sysPermissionMapper.selectPage(page, queryWrapper);
        return PageUtil.buildPage(page, SysPermissionVo.class);
	}
	
	

}
